home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / SHELLS / SZ2 / INPUT2.DEF < prev    next >
Text File  |  1992-08-31  |  2KB  |  68 lines

  1. .Evolving an Application:  Data Entry Dialog, encapsulated w/Edit mode
  2.  
  3. COMMENTS
  4. --------
  5. Okay, we've managed to accomplish a number of things:
  6.  
  7. (1) We've created a dialog object which handles all record events
  8.     internally; it's "encapsulated".
  9.  
  10. (2) We've added an "Edit mode", which:
  11.     (a) Beeps on keyboard input, unless the user activates "Edit".
  12.     (b) Turns on "StaticText", which tells use how to move from field
  13.         to field.
  14.     (c) Sets the screen's border color (color systems only).
  15.  
  16. (3) Hints are now "off" when not editing.
  17.     The "GetHelpCtx" method for the object will return "hcNoContext"
  18.     when NOT in "Edit" mode.  This will turn off hints, since the
  19.     StatusLine is context sensitive.
  20.  
  21. NOTE - Now, there is no new "Application^.HandleEvent", since all
  22. events (so far) in this application are encapsulated.
  23.  
  24.  
  25. UPSIDE
  26. ------
  27. The user can't accidentally over-write data; they've gotta
  28. deliberately activate "Edit" mode by pressing "F2".  They can still
  29. browse the database, whether in "Edit" or "View" mode.
  30.  
  31.  
  32. DOWNSIDE
  33. --------
  34. Gosh, darn it - we forgot a ScrollBar!  What kind of Application are
  35. you writing here, anyhow?  And the user did WHAT!  Closed the dialog
  36. while in Edit mode?  Sigh...ok, let's see what we can do next.
  37.  
  38. @PA - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  39.  
  40.  
  41.  
  42. [ UNIT ]
  43. General            /R                       @@ Use & Register
  44.  
  45. [ DIALOG ]
  46. input
  47.  
  48. [ DEFINE ]
  49. PrevRecord,NextRecord,First,Last,Edit       @@ SHAZAM creates & numbers'em
  50.  
  51. [ INTERNAL ]
  52. PrevRecord,NextRecord,First,Last,Edit       @@ Don't put in ^.HandleEvent,
  53.                                             @@ since new "TForm" does it.
  54.  
  55. [ SUBMENU ] Record                     ;;move around
  56. Edit    F2                             ;;Edit/View mode
  57. [ NEWLINE ]
  58. next    PgDn       cmNextRecord        ;;next record
  59. prior   PgUp       cmPrevRecord        ;;prior record
  60. first   Ctrl-PgUp                      ;;show the first record
  61. last    Ctrl-PgDn                      ;;show the last record
  62.  
  63. [ HINT ]
  64. hcName                  ;;who is this?
  65. hcAddress               ;;where do they live?
  66. hcPhone                 ;;how do I contact them?
  67. hcMemo                  ;;why I am typing in their name?
  68.